package com.wangzifan.mapper;

import com.wangzifan.entity.Student;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StudentMapper {
    List<Student> queryStudent(String sno,String sname,Short gender);

    void deleteStudent(List<Integer> ids);

    @Insert("insert into score_database.student(sno, sname, age, gender, major, entry_year, class_name)" +
            "values(#{sno},#{sname},#{age},#{gender},#{major},#{entryYear},#{className})")
    void addStudent(Student student);

    @Select("select * from score_database.student where id=#{id}")
    Student queryStudentById(Integer id);

    void updateStudent(Student student);
}
